<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/app.css">
    <link rel="stylesheet" type="text/css" href="../../css/index.css">
    <script type="text/javascript" src="../../js/jquery.min.js"></script>
    <script type="text/javascript" src="/h5/js/all.js"></script>
</head>
<body>
<!--
    制作者：九哥
    页面：岗位详情页面
    时间：2019-09-27
-->





<!----------岗位详情页面---------->
<div id="jobShowPage">
    <div id="jobShowTitle">
        <b>我的简历</b>
        <img src="../../images/return.png" id="jobShowRtn"
             onclick="history.go(-1);">
    </div>
    <div id="jobShowDetail">
        <table>
            <tr>
                <td width="60">
                    <span id="head"></span>
                </td>
                <td>
                    <p>用户名：
                        <span id="uname"></span>
                    </p>
                    <p>招聘性别：
                        <span id="sexName"></span>
                    </p>
                    <p>招聘电话：
                        <span id="mobile"></span>
                    </p>
                </td>
            </tr>
        </table>
        <div style="height:10px;background:#f8f8f8;"></div>
        <div class="detail">
            <!--<p style="border-bottom:1px solid #f8f8f8;">-->
                <!--<img src="../../images/locate.png" width="8">-->
                <!--所在地区-->
                <!--<span style="float:right;" id="address"></span>-->
            <!--</p>-->
            <p>
                出生日期：
                <span id="birthday"></span>
                <br><br>
                学历：
                <span id="eduName"></span>
                <br><br>
                体重：
                <span id="weight"></span>
                <br><br>
                婚姻状态：
                <span id="marryName"></span>
                <br><br>
                住宿情况：
                <span id="house"></span>
                <br><br>
                期望薪资：
                <span id="salary"></span>
                <br><br>
                期望工作：
                <span id="jobName"></span>
            </p>
            <b>形象照</b>
            <p>
                <span id="image"></span>
            </p>
            <b>需要技能</b>
            <p>
                <span id="skill"></span>
            </p>
            <b>兴趣爱好</b>
            <p>
                <span id="hobby"></span>
            </p>
            <hr>
            <p class="submit">
                设置简历是否被企业搜索到？
                <span id="resume"></span>
                <br><br>
                <button onclick="modify()">编辑简历</button>
                &nbsp; &nbsp;
                <span id="resume00"></span>
                <!--<button onclick="setResume(0)" id="resume01"-->
                        <!--style="display:none;">关闭搜索</button>-->
                <!--<button onclick="setResume(1)" id="resume02"-->
                        <!--style="display:none;">开启搜索</button>-->
            </p>
            <br><br><br>
        </div>
    </div>
</div>
<input type="hidden" id="cid" value="0">
<!----------岗位页面---------->





<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../../js/app.js"></script>
<script type="text/javascript" src="../../js/cache.js"></script>
</html>


<script type="text/javascript">
    (function(){
        getShowList();
    })();
    //编辑详情
    function modify(){
        window.location.href = '/h5/login/staffList.html';
    }
    //简历详情
    function getShowList(){
        var userInfo = cacheGet('userInfo');
        var formData = {
            app_access:app_access,
            token:userInfo.token
        };
        $.ajax({
            type:'post',
            url:'/api/my/job/resume-get',
            data:formData,
            success: function (res) {
                //console.log(res); return
                var resume = '';
                if (res.code!=0) {
                    resume += '<button class="grey" onclick="setResume(0)"  id="resume01">关闭搜索</button>';
                    resume += '<button onclick="setResume(1)" id="resume02" style="display:none;">开启搜索</button>';
                    $('#resume00').html(resume);
                    getAppErrMsg(res.msg,'',0);
                    console.log(res);
                    return
                }
                console.log(res.data);
                var resData = res.data;
                //简历搜索控制按钮
                var resume = '';
                if (resData.resume==1) {
                    resume = '【已开启搜索】';
//                    $('#resume01').show(); $('#resume02').hide();
                    resume += '<button onclick="setResume(0)" id="resume01">关闭搜索</button>';
                    resume += '<button id="resume02" onclick="setResume(1)"  style="display: none;">开启搜索</button>';
                } else {
                    resume = '【已关闭搜索】';
//                    $('#resume01').hide(); $('#resume02').show();
                    resume += '<button id="resume01"  onclick="setResume(0)"  style="display: none;">关闭搜索</button>';
                    resume += '<button onclick="setResume(1)" id="resume02">开启搜索</button>';
                }
                $('#resume00').html(resume);
                //下面是简历资料
                var head = '<img src="../../images/toux01.png" width="40">';
                if (resData.head!='') {
                    head = '<img src="'+resData.head+'" width="40">';
                }
                var image = '<img src="../../images/toux01.png" width="90%">';
                if (resData.image!='') {
                    image = '<img src="'+resData.image+'" width="90%">';
                }
                console.log(head,image);
                $('#head').html(head); $('#image').html(image);
                $('#uname').html(resData.uname);
                $('#jobName').html(resData.jobName);
                $('#sexName').html(resData.sexName);
                $('#mobile').html(resData.mobile);
                $('#birthday').html(resData.birthday);
                $('#eduName').html(resData.eduName);
                $('#weight').html(resData.weight);
                $('#marryName').html(resData.marryName);
                $('#house').html(resData.house);
                $('#salary').html(resData.salary);
                if (resData.skill) {
                    $('#skill').html(resData.skill);
                } else {
                    $('#skill').html('没有');
                }
                if (resData.hobby) {
                    $('#hobby').html(resData.hobby);
                } else {
                    $('#hobby').html('没有');
                }
            }
        });
    }
    //设置简历是否被企业搜索
    function setResume(v){
        var userInfo = cacheGet('userInfo');
        var formData = {
            app_access:app_access,
            token:userInfo.token,
            resume:v
        };
        $.ajax({
            type:'post',
            url:'/api/my/job/resume-set',
            data:formData,
            success: function (res) {
                //console.log(res); return
                if (res.code!=0) {
                    getAppErrMsg(res.msg,'',2);
                    console.log(res);
                    return
                }
                console.log(res.data);
                var resData = res.data;
                var resume = '';
                if (v==1) {
                    resume = '【已开启搜索】';
                    $('#resume01').show(); $('#resume02').hide();
                } else {
                    resume = '【已关闭搜索】';
                    $('#resume01').hide(); $('#resume02').show();
                }
                $('#resume').html(resume);
                getAppErrMsg('设置成功！','');
            }
        });
    }
</script>